package org.se.lab;

import org.junit.Assert;
import org.junit.Test;

public class TestMail {

	@Test
	public void mailTest() {
		User lyli = new User(1, "lyli", "*****");
		lyli.addMail(new Mail("lyli@lyli"));
		lyli.addMail(new Mail("lyli@gmoil"));
		System.out.println(lyli.toString());

		Assert.assertEquals("lyli", lyli.getUsername());

		/*
		 * get mails list size
		 */
		Assert.assertEquals(2, lyli.getMails().size());

		/*
		 * finds first and second index in my list
		 */
		Assert.assertEquals("lyli@lyli", lyli.getMails().get(0).getAddress());
		Assert.assertEquals("lyli@gmoil", lyli.getMails().get(1).getAddress());
		
		Mail m1 = new Mail("Mauricio@");
		Assert.assertEquals("Mauricio@", m1.getAddress());
		System.out.println(m1.toString());
	}

}
